package com.cwnu.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotNull;

import java.time.LocalDateTime;

public class Comment {
    @NotNull
    private Integer id; // 评论id

    @NotNull
    private Integer articleId; // 对应的文章的id

    @NotNull
    private Integer createId; // 创建人id

    @NotNull
    private String content; // 评论内容

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime; // 创建时间

    public Comment() {
    }

    public Comment(Integer id, Integer articleId, Integer createId, String content, LocalDateTime createTime) {
        this.id = id;
        this.articleId = articleId;
        this.createId = createId;
        this.content = content;
        this.createTime = createTime;
    }

    /**
     * 获取
     * @return id
     */
    public Integer getId() {
        return id;
    }

    /**
     * 设置
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取
     * @return articleId
     */
    public Integer getArticleId() {
        return articleId;
    }

    /**
     * 设置
     * @param articleId
     */
    public void setArticleId(Integer articleId) {
        this.articleId = articleId;
    }

    /**
     * 获取
     * @return createId
     */
    public Integer getCreateId() {
        return createId;
    }

    /**
     * 设置
     * @param createId
     */
    public void setCreateId(Integer createId) {
        this.createId = createId;
    }

    /**
     * 获取
     * @return content
     */
    public String getContent() {
        return content;
    }

    /**
     * 设置
     * @param content
     */
    public void setContent(String content) {
        this.content = content;
    }

    /**
     * 获取
     * @return createTime
     */
    public LocalDateTime getCreateTime() {
        return createTime;
    }

    /**
     * 设置
     * @param createTime
     */
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public String toString() {
        return "Comment{id = " + id + ", articleId = " + articleId + ", createId = " + createId + ", content = " + content + ", createTime = " + createTime + "}";
    }
}
